﻿using System.Collections.Generic;

public abstract class ModelBase
{
    public string name;
    public ModelBase(string name)
    {
        this.name = name;
    }
}
public class ModelManager:Singleton<ModelManager>
{
    Dictionary<string, ModelBase> dic = new Dictionary<string, ModelBase>();
    public void AddModel(ModelBase model)
    {
        if (!dic.ContainsKey(model.name))
        {
            dic.Add(model.name, model);
        }
    }
    public ModelBase GetModel(string name)
    {
        if (dic.ContainsKey(name))
        {
            return dic[name];
        }
        else
        {
            return null;
        }
    }
}
